public class NearestNeighbor implements Sampling {

    public int[] getSample(ImageAsArray.ImageAsArrayHolder img, float x, float y, float param) {

	int[] val = new int[4];

	int ix = (int) Math.floor(x);
	int iy = (int) Math.floor(y);

	for (int i = 0; i < 4; i++)
	    val[i] = img.pixels_ARGB[(iy * img.width + ix) * 4 + i];

	return val;
    }

}